/// @tags: DP NIM XOR
#include <cstdio>
#include <cstring>
#include <iostream>

using std::cin;
using std::cout;

namespace BlueQuantum {

constexpr int MAXN = 2e2 + 3, P = 1e9 + 7, VAL = 256;

int n, a[MAXN], dp[MAXN][VAL];

inline void solve(int x) {
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < VAL; ++j) {
      if (i == x) {
        dp[i][j] = dp[i - 1][j];
        continue;
      }
      dp[i][j] = (dp[i - 1][j] + dp[i - 1][j ^ a[i]]) % P;
    }
  }
}

inline int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    solve(i);
    for (int j = a[i]; j < VAL; ++j) {
      ans = (ans + dp[n][j]) % P;
    }
  }
  cout << ans;
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P5675 [GZOI2017] 取石子游戏.in", "r", stdin);
  freopen("P5675 [GZOI2017] 取石子游戏.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
